Skip to content

make grouping column an agg #6997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

hayd
Copy link
Contributor

@hayd hayd commented Apr 29, 2014

fixes #5610

@jreback jreback added this to the 0.14.0 milestone Apr 29, 2014
@jreback jreback added Bug and removed API Design labels Apr 29, 2014
@@ -955,7 +964,14 @@ def _python_agg_general(self, func, *args, **kwargs):
for name, obj in self._iterate_slices():
try:
result, counts = self.grouper.agg_series(obj, f)
output[name] = self._try_cast(result, obj)

if _dtype is None: # infer old dytpe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is all this necessary? _try_cast does this IIRC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like agg must upcast to float, i can't recall tbh... also my choice of api is not good.

I'm not even using it, so er... guess I should remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, it upcast to float... this explains the "wip" commit message

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but try_cast should still be able to fix it maybe it needs more hints)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take this - u can lot on plate!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be amazing, thanks! This was also attempting to address #6594 btw, looks like ohlc in there twice.

@jreback
Copy link
Contributor

jreback commented Apr 29, 2014

closing in favor of #7000

@jreback jreback closed this Apr 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GroupBy.count() returns the grouping column as both index and column
3 participants